Configure NFS Client
2015/12/02 |
This example is based on the environment below.
+----------------------+ | +----------------------+ | [ NFS Server ] |10.0.0.30 | 10.0.0.31| [ NFS Client ] | | dlp.srv.world +----------+----------+ www.srv.world | | | | | +----------------------+ +----------------------+ |
[1] | Configure NFS Client. |
www:~ #
zypper -n install nfs-client
www:~ #
vi /etc/idmapd.conf # line 5: change to your domain name Domain = srv.world
mount -t nfs dlp.srv.world:/home /home www:~ # df -hT Filesystem Type Size Used Avail Use% Mounted on /dev/vda2 ext3 28G 3.3G 24G 13% / udev tmpfs 1.9G 100K 1.9G 1% /dev tmpfs tmpfs 1.9G 648K 1.9G 1% /dev/shm dlp.srv.world:/home nfs 28G 3.3G 24G 13% /home # home directory from NFS server is mounted
|
[2] | Configure NFS mounting on fstab to mount it when the system boots. |
www:~ #
vi /etc/fstab # add NFS mount's settings to the end dlp.srv.world:/home /home nfs defaults 0 0 |
[3] | Configure auto-mounting. For example, set NFS directory on /mntdir. |
www:~ #
zypper -n install autofs
www:~ #
vi /etc/auto.master # add follows to the end /- /etc/auto.mount
www:~ #
vi /etc/auto.mount # create new : [mount point] [option] [location] /mntdir -fstype=nfs,rw dlp.srv.world:/home # move to the mount point to make sure it normally mounted www:~ # cd /mntdir www:/mntdir # total 4 drwxr-xr-x 5 suse users 4096 Nov 27 12:02 susewww:/mntdir # cat /proc/mounts | grep mntdir /etc/auto.mount /mntdir autofs rw,relatime,fd=6,pgrp=3263,timeout=600,minproto=5,maxproto=5,direct 0 0 dlp.srv.world:/home /mntdir nfs rw,relatime,vers=3,rsize=524288,wsize=524288,namlen=255,hard, proto=tcp,timeo=600,retrans=2,sec=sys,mountaddr=10.0.0.30,mountvers=3,mountport=60305,mountproto=udp, local_lock=none,addr=10.0.0.30 0 0 |